package JAVATest;

import java.util.Random;

/**
 * ClassName:Text_013
 * Package:JAVATest
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/12-23:34
 * @Version:v1.0
 */
public class Text_013 {
    public static void main(String[] args) {
        double sum = 0.0;
        Random r = new Random();
        int[] arr = new int[6];
        int[] newArr = new int[4];
        extracted(sum, r, arr);
    }

    private static void extracted(double sum, Random r, int[] arr) {
        for (int i = 0; i < 6; i++) {
            arr[i] = r.nextInt(100);
        }
        int max = arr[0];
        int min = arr[0];
        double avg = 0;
        for (int i = 0; i < 6; i++) {
            System.out.print(arr[i] + " ");
            if (arr[i] > max) {
                max = arr[i];
            }
            if (arr[i] < min) {
                min = arr[i];
            }
            sum += arr[i];
        }
        sum = sum - max - min;
        avg = sum / 4;
        System.out.print("\n");
        System.out.println("平均分数："+ avg);
    }
}

